//
//  ViewController.m
//  点击手势
//
//  Created by clz on 2019/9/15.
//  Copyright © 2019 clz. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    UIImageView *imageView = [[UIImageView alloc]init];
    imageView.image = [UIImage imageNamed:@"testImage"];
    [self.view addSubview:imageView];
    imageView.frame = CGRectMake(0, 200, 100, 100);
//    imageView.bounds = CGRectMake(0, 0, 100, 100);
    imageView.center = self.view.center;
    imageView.userInteractionEnabled = YES;
    
    //点击手势
    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapClick:)];
    tapGesture.numberOfTapsRequired = 1;
    tapGesture.numberOfTouchesRequired  = 1;
    [imageView addGestureRecognizer:tapGesture];
    
    
    
}

- (void)tapClick:(UITapGestureRecognizer *)sender{
    NSLog(@"触发");
}




@end
